import { Component, ElementRef, Renderer2 } from '@angular/core';
import { ApesField } from '@shared/ui-zorro/src/types/apes-field';
import { ApiService } from '@core/services/http/api.service';
import { Events } from '@core/services/events/Events';
import { ExpressionService } from '@core/services/expression/ExpressionService';
import { SubjectService } from '@core/services/events/subject.service';
import { exists } from '../../../../utils/utils';
import { toBoolean } from '@shared/apes/core';

@Component({
  selector: 'formly-field-custom-card',
  template: `
    <apes-custom-card [formControl]="formControl"
                      [formlyAttributes]="field"
                      [params]="to"
                      [ctx]="formState"></apes-custom-card>
  `,
})
export class FormlyFieldCustomCard extends ApesField {

  constructor(protected apiService: ApiService, protected events: Events, protected expressionService: ExpressionService, protected subject: SubjectService, protected elementRef: ElementRef, protected renderer: Renderer2) {
    super(apiService, events, expressionService, subject);
  }

  ngOnInit(): void {
    this.addEventListener(this.elementRef, this.renderer);
  }

}
